package com.only4play.portal.common.session;

import java.util.Enumeration;

/**
 * @author liyuncong
 * @version 1.0
 * @file StandardSessionFacade
 * @brief StandardSessionFacade
 * @details StandardSessionFacade
 * @date 2024-06-12
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-06-12               liyuncong          Created
 */
public class StandardSessionFacade implements PortalSession {

    /**
     * Wrapped session object
     */
    private PortalSession session = null;

    public StandardSessionFacade(PortalSession session) {
        this.session = session;
    }

    public InternalSession getSession() {
        return (InternalSession) this.session;
    }

    @Override
    public Object getAttribute(String name) {
        return this.session.getAttribute(name);
    }

    @Override
    public Enumeration<String> getAttributeNames() {
        return this.session.getAttributeNames();
    }

    @Override
    public void setAttribute(String name, Object value) {
        this.session.setAttribute(name, value);
    }

    @Override
    public void removeAttribute(String name) {
        this.session.removeAttribute(name);
    }

    @Override
    public void invalidate() {
        this.session.invalidate();
    }
}
